#include <stdio.h>
#include <stdint.h>

#include "common_errno.h"
#include "common_interface.h"

int main() {
    uint8_t test = 0x0;
    int ret = 0;
    int i;

    for(i = -2; i <= 10; i++) {
        test = 0;
        ret = common_byte_1_set(&test, COMMON_BYTE_ONE, i);

        printf("ret = 0x%04x\n", ret);
        printf("0x%0x\n\n", test);
    }

    test = 0x11;
    common_byte_type type = 0;
    for(i = 7; i >= 0; i--) {
        ret = common_byte_1_get(&test, &type, i);
        if(ret != COM_OK) {
            printf("error at line: %d, i = %d\n", __LINE__, i);
            return 1;
        }
        printf("%d ", type);
    }
    printf("\n");

    return 0;
}